package com.xce.account;

import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import com.xce.config.FeignConfig;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.core.env.Environment;

import java.net.InetAddress;

/**
 * @ClassName AccountMainApplication
 * @Description TODO
 * @Author lld
 * @Date 2025/7/9 4:17
 * @Version 1.0
 */

@Slf4j
@EnableKnife4j
@EnableFeignClients(defaultConfiguration = FeignConfig.class)
@MapperScan("com.xce.account.mapper")
@SpringBootApplication
public class AccountMainApplication  implements ApplicationRunner {

    @Autowired
    private Environment env;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        InetAddress inetAddress = InetAddress.getLocalHost();
        String ip = inetAddress.getHostAddress();
        log.info("接口地址：http://{}:{}/doc.html", ip, env.getProperty("server.port"));
    }
    public static void main(String[] args) {
        SpringApplication.run(AccountMainApplication.class, args);
    }
}
